import '../constants/index.dart';
import '../utils/RequestDio.dart';

Future<dynamic> getAnnounceListAPI({Map<String, dynamic>? params}) =>
    requestDio.get(HTTP_PATH.ANNOUNCE_LIST, params: params);

// dynamic 没办法as 成class
// Flutter dynamic类型转化class

Future<dynamic> getAnnounceDetailAPI(String id) =>
    requestDio.get('${HTTP_PATH.ANNOUNCE_LIST}/$id');

// flutter 只支持显式的转化成class
// 鸿蒙可以直接as 成class
// class People {
//   String? name;
//   int? age;
//   People({this.age, this.name});
//   factory People.fromMap(Map<String, dynamic>? params) {
//     return People(name: params!["name"], age: params["age"]);
//   }
// }
